﻿package plugin.mobai.handler
{
    import com.core.*;
    import flash.utils.*;
    import plugin.mobai.consts.*;
    import pluginfw.nio.*;
    import pluginfw.nio.imsg.*;

    public class MoBaiHandler extends Object implements IGroupHandler
    {

        public function MoBaiHandler()
        {
            return;
        }// end function

        public function dealSimpleMessage(param1:ISimpleMessage) : void
        {
            switch(param1.getCmd())
            {
                case CMDMoBai.OpenBack:
                {
                    ModelProxy.change("mobai", "show", param1.getParam());
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        public function dealBufferMessage(param1:IBufferMessage) : void
        {
            var _loc_2:* = new Object();
            var _loc_3:* = new Input(null);
            var _loc_4:* = param1.getBody();
            param1.getBody().position = 0;
            switch(param1.getCmd())
            {
                case CMDMoBai.RefreshBack:
                {
                    _loc_3.setBytes(_loc_4);
                    _loc_2.num = _loc_3.readVarInt(false);
                    ModelProxy.change("mobai", "changebeishu", _loc_2.num);
                    break;
                }
                case CMDMoBai.Expback:
                {
                    _loc_3.setBytes(_loc_4);
                    _loc_2.exp = _loc_3.readLong().toNumber();
                    ModelProxy.change("mainui", "updatemobaiexp", _loc_2.exp);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        public function dealProxyMessage(param1:IProxyMessage) : void
        {
            return;
        }// end function

    }
}
